package com.lzk.feignclients;

import com.lzk.domain.User;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserFeignClientFallbackFactory implements FallbackFactory<UserFeignClient> {

    @Override
    public UserFeignClient create(Throwable throwable) {
        return new UserFeignClient() {
            @Override
            public User getById(Integer id) {
                return new User(-1,"飞飞侠","熔断开启");
            }
        };
    }
}
